﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CitizenID.aspx.cs" Inherits="CitizenID" MasterPageFile="~/MasterPage.master"%>

<asp:Content ID="content1" runat="server" ContentPlaceHolderID="MainContentPlaceHolder">
 
    <div>
    
        <table style="width:100%;">
            <tr>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" 
                        AutoGenerateRows="False" CellPadding="4" DataKeyNames="UID_Number" 
                        DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" 
                        Height="50px" Width="364px">
                        <AlternatingRowStyle BackColor="White" />
                        <CommandRowStyle BackColor="#FFFFC0" Font-Bold="True" />
                        <FieldHeaderStyle BackColor="#FFFF99" Font-Bold="True" />
                        <Fields>
                            <asp:BoundField DataField="UID_Number" HeaderText="UID Number" ReadOnly="True" 
                                SortExpression="UID_Number" />
                            <asp:BoundField DataField="PAN_Card_NUmber" HeaderText="PAN Card Number" 
                                SortExpression="PAN_Card_NUmber" />
                            <asp:BoundField DataField="Driving_License_Number" 
                                HeaderText="Driving License Number" SortExpression="Driving_License_Number" />
                            <asp:BoundField DataField="First_Name" HeaderText="First Name" 
                                SortExpression="First_Name" />
                            <asp:BoundField DataField="Last_Name" HeaderText="Last Name" 
                                SortExpression="Last_Name" />
                            <asp:BoundField DataField="Address" HeaderText="Address" 
                                SortExpression="Address" />
                            <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
                            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                                ShowInsertButton="True" />
                        </Fields>
                        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                    </asp:DetailsView>
                    < <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                                    ConnectionString="<%$ ConnectionStrings:PAS_DB %>"
                        DeleteCommand="DELETE FROM [CitizenRecord] WHERE [UID_Number] = @UID_Number" 
                        InsertCommand="INSERT INTO [CitizenRecord] ([UID_Number], [PAN_Card_NUmber], [Driving_License_Number], [First_Name], [Last_Name], [Address], [City]) VALUES (@UID_Number, @PAN_Card_NUmber, @Driving_License_Number, @First_Name, @Last_Name, @Address, @City)" 
                        SelectCommand="SELECT * FROM [CitizenRecord]" 
                        UpdateCommand="UPDATE [CitizenRecord] SET [PAN_Card_NUmber] = @PAN_Card_NUmber, [Driving_License_Number] = @Driving_License_Number, [First_Name] = @First_Name, [Last_Name] = @Last_Name, [Address] = @Address, [City] = @City WHERE [UID_Number] = @UID_Number">
                        <DeleteParameters>
                            <asp:Parameter Name="UID_Number" Type="String" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="UID_Number" Type="String" />
                            <asp:Parameter Name="PAN_Card_NUmber" Type="String" />
                            <asp:Parameter Name="Driving_License_Number" Type="String" />
                            <asp:Parameter Name="First_Name" Type="String" />
                            <asp:Parameter Name="Last_Name" Type="String" />
                            <asp:Parameter Name="Address" Type="String" />
                            <asp:Parameter Name="City" Type="String" />
                        </InsertParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="PAN_Card_NUmber" Type="String" />
                            <asp:Parameter Name="Driving_License_Number" Type="String" />
                            <asp:Parameter Name="First_Name" Type="String" />
                            <asp:Parameter Name="Last_Name" Type="String" />
                            <asp:Parameter Name="Address" Type="String" />
                            <asp:Parameter Name="City" Type="String" />
                            <asp:Parameter Name="UID_Number" Type="String" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    
    </div>
 </asp:Content>
<asp:Content ID="Content2" runat="server" contentplaceholderid="head">
    <style type="text/css">
        .style2
        {
            width: 264px;
        }
    </style>
</asp:Content>
